layui.use(['form','jquery','table','layer','laydate'],function(){
    let form = layui.form,
        $ = layui.jquery,
        table = layui.table,
        layer = layui.layer,
        laydate=layui.laydate;
    console.log(sessionStorage.getItem("customerId"));
    $.get( '/customer-info/detail/'+sessionStorage.getItem("customerId"),function (res) {
        console.log(res);
        $('input[name=customerId]').attr('value',res.data.customerId);
        $('input[name=customerName]').attr('value',res.data.customerName);
        $('input[name=customerMgrId]').attr('value',res.data.customerMgrId);
        $('select[name=city]').find("option[value=\'"+res.data.city+"\']").attr("selected",true);
        $('input[name=customerMgr]').attr('value',res.data.customerMgr);
        $('select[name=customerGrade]').find("option[value=\'"+res.data.customerGrade+"\']").attr("selected",true);
        $('select[name=customerSatisfaction]').find("option[value=\'"+res.data.customerSatisfaction+"\']").attr("selected",true);
        $('select[name=customerCredit]').find("option[value=\'"+res.data.customerCredit+"\']").attr("selected",true);
        $('input[name=address]').attr('value',res.data.address);
        $('input[name=postalCode]').attr('value',res.data.postalCode);
        $('input[name=phone]').attr('value',res.data.phone);
        $('input[name=fax]').attr('value',res.data.fax);
        $('input[name=ulr]').attr('value',res.data.ulr);
        $('input[name=businessLicense]').attr('value',res.data.businessLicense);
        $('input[name=juridicalPerson]').attr('value',res.data.juridicalPerson);
        $('input[name=registeredCapital]').attr('value',res.data.registeredCapital);
        $('input[name=annualSales]').attr('value',res.data.annualSales);
        $('input[name=depositBank]').attr('value',res.data.depositBank);
        $('input[name=bankAccount]').attr('value',res.data.bankAccount);
        $('input[name=landTaxCode]').attr('value',res.data.landTaxCode);
        $('input[name=centralTax]').attr('value',res.data.centralTax);
        $('input[name=founder]').attr('value',res.data.founder);
        $('input[name=foundId]').attr('value',res.data.foundId);
        $('input[name=creationTime]').attr('value',res.data.creationTime);
        form.render('select');
    });

    laydate.render({
        elem:'#creationTime',
        type:'datetime',
        format:'yyyy-MM-dd HH:mm:ss',
        max:0,
    });

});
